home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / rpm / rpmmessages.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-22  |  2.3 KB  |  91 lines

  1. #ifndef H_RPMMESSAGES
  2. #define H_RPMMESSAGES
  3.  
  4. /** \ingroup rpmio
  5.  * \file rpmio/rpmmessages.h
  6.  * @todo Eliminate from API.
  7.  */
  8.  
  9. #include "rpmlog.h"
  10.  
  11. #define    RPMMESS_DEBUG        RPMLOG_DEBUG
  12. #define    RPMMESS_VERBOSE        RPMLOG_INFO
  13. #define    RPMMESS_NORMAL        RPMLOG_NOTICE
  14. #define    RPMMESS_WARNING        RPMLOG_WARNING
  15. #define    RPMMESS_ERROR        RPMLOG_ERR
  16. #define    RPMMESS_FATALERROR    RPMLOG_CRIT
  17.  
  18. #define    RPMMESS_QUIET        RPMMESS_WARNING
  19.  
  20. #define    rpmMessage        rpmlog
  21. #define    rpmSetVerbosity(_lvl)    \
  22.     ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
  23. #define    rpmIncreaseVerbosity()    \
  24.     ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
  25. #define    rpmDecreaseVerbosity()    \
  26.     ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
  27. #define    rpmIsNormal()        \
  28.     (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_NORMAL ))
  29. #define    rpmIsVerbose()        \
  30.     (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_VERBOSE ))
  31. #define    rpmIsDebug()        \
  32.     (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_DEBUG ))
  33.  
  34. /*@-redef@*/ /* LCL: ??? */
  35. typedef /*@abstract@*/ const void * fnpyKey;
  36. /*@=redef@*/
  37.  
  38. /**
  39.  * Bit(s) to identify progress callbacks.
  40.  */
  41. typedef enum rpmCallbackType_e {
  42.     RPMCALLBACK_UNKNOWN        = 0,
  43.     RPMCALLBACK_INST_PROGRESS    = (1 <<  0),
  44.     RPMCALLBACK_INST_START    = (1 <<  1),
  45.     RPMCALLBACK_INST_OPEN_FILE    = (1 <<  2),
  46.     RPMCALLBACK_INST_CLOSE_FILE    = (1 <<  3),
  47.     RPMCALLBACK_TRANS_PROGRESS    = (1 <<  4),
  48.     RPMCALLBACK_TRANS_START    = (1 <<  5),
  49.     RPMCALLBACK_TRANS_STOP    = (1 <<  6),
  50.     RPMCALLBACK_UNINST_PROGRESS    = (1 <<  7),
  51.     RPMCALLBACK_UNINST_START    = (1 <<  8),
  52.     RPMCALLBACK_UNINST_STOP    = (1 <<  9),
  53.     RPMCALLBACK_REPACKAGE_PROGRESS = (1 << 10),
  54.     RPMCALLBACK_REPACKAGE_START    = (1 << 11),
  55.     RPMCALLBACK_REPACKAGE_STOP    = (1 << 12),
  56.     RPMCALLBACK_UNPACK_ERROR    = (1 << 13),
  57.     RPMCALLBACK_CPIO_ERROR    = (1 << 14)
  58. } rpmCallbackType;
  59.  
  60. /**
  61.  */
  62. typedef void * rpmCallbackData;
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67.  
  68. /**
  69.  */
  70. typedef void * (*rpmCallbackFunction)
  71.         (/*@null@*/ const void * h, 
  72.         const rpmCallbackType what, 
  73.         const unsigned long amount, 
  74.         const unsigned long total,
  75.         /*@null@*/ fnpyKey key,
  76.         /*@null@*/ rpmCallbackData data)
  77.     /*@globals internalState@*/
  78.     /*@modifies internalState@*/;
  79.  
  80. /**
  81.  */
  82. /*@unused@*/
  83. void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
  84.         int notifyCount);
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif  /* H_RPMMESSAGES */
  91.